package com.wenjie.original.entity.common;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.mybatisflex.annotation.Column;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.io.Serializable;

@Data
@ApiModel("Entity基类")
public class BaseEntity implements Serializable {
    private static final long serialVersionUID = 1L;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @ApiModelProperty("创建时间")
    @Column(onInsertValue = "UNIX_TIMESTAMP()")
    private Long createTime;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @ApiModelProperty("更新时间")
    @Column(onUpdateValue = "UNIX_TIMESTAMP()", onInsertValue = "UNIX_TIMESTAMP()")
    private Long updateTime;

    @JsonIgnore
//    @Column(version = true)
    private Long version;

    @JsonIgnore
    @Column(isLogicDelete = true)
    @ApiModelProperty("逻辑删除")
    private Long delFlag = 0l;

}
